	/** 
	 * This creates a new Strands call frame. It becomes the scope for the function maintains variables and parameters across suspensions and resumes. It should only be used in compiled code
	 */	
	_frm = function(frameThis,args,argNames,varNames,noScopeNeeded) {
		if (args.caller) args.caller=0; // this fixes a big memory leak;
		if (suspendedFrame) {
			// if it is loading we start a new frame
			if (suspendedFrame.thread == currentThread && suspendedFrame.func && !suspendedFrame.NRY) {// this means we are resuming
				var frame = suspendedFrame;
				//TODO: Implement this:
				if (frame.func != args.callee && frame.func.toString() != args.callee.toString()) {// this means the function that is being called has changed, the function has been replaced, so we need to call the orginal one
	//				if (this!=frame.frameThis) {
						suspendedFrame = null;
						StackAlterationError("The function has changed, the means for handling this right now is not complete");
		//			}
/*					var retValue = frame.func.call(frame.frameThis);
					if (retValue == _S){
						// this is the tricky part, we need to call the next function and have it be guaranteed to return a _S
					}
					else {// we need to come up with a way to ensure that we have the right rv#
						frame["rv" + frame.cp++] = retValue;  //make sure we increment the cp so we are the next part
					}
					return frame;*/
				}
				delete frame.thread;
	
				suspendedFrame = frame.childFrame; // if this is undefined it means we are at the top of the resume stack
				delete frame.childFrame; // for assertions
				if (suspendedFrame && suspendedFrame._r) {//Assertion stuff
					if (! suspendedFrame.parentFrame)
						SuspendedFrameHasNoParentFrame;
					else
						delete suspendedFrame.parentFrame;				
				}
				frame.scp=0; // start in the suspend segment
				return frame;
			}
			else { // this case means that there is a suspendedFrame variable left over from a previous resume/suspension
				// It should only be a left over from a suspension, and it should be the bottom frame.  A resume should null out suspendedFrame
	
				suspendedFrame = null;  // a suspension took place somewhere else, so now we can get rid of this
			}
		}
		frame = new CallFrame;
		frame.scp = 2; // Why is this needed for opera to work? somewhere the prototype _cp is getting set, need to figure out why
		frame.func = args.callee;
		frame.frameThis  = frameThis;
		return frame;
	}
	function Generator(frame){
		this.frame = frame;
	};
	Generator.prototype = {
		next : function() {
			return this.send();
		},
		send : function(value) {			
			suspendedFrame = this.frame;
			suspendedFrame.thread = currentThread;
			_receive = value;
			return this.frame.func.call(this.frame.frameThis);			
		}
	} 
	_gen = function(frame) {
		return new Generator(frame);
	}
	